<template>
	<view class="mainBg h100 ">
		<view class="container">
			<view class="logo">
				<image src="@/static/logo.svg" mode=""></image>
				<view class="">
					{{userInfo.nickname}}
				</view>
			</view>
			<view class="submit" @click="submit" v-if="userInfo.checkStatus == 1">
				直接登录
			</view>
			<view class="submit" v-if="userInfo.checkStatus == 0">
				正审核中...
			</view>
			<view class="submit" v-if="userInfo.checkStatus == 2">
				未通过审核...
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				show: false,
				userInfo:null,
			}
		},
		onShow() {
			this.getInfo()
		},
		methods: {
			getInfo() {
				this.$post("/user/info").then(res => {
					this.userInfo = res.data.userInfo
					
					if(this.userInfo.checkStatus == 1)
					{
						uni.showLoading({
							title:"数据加载中..."
						})
						setTimeout(()=>{
							uni.hideLoading()
							this.submit()
						},1000)
					}
					
				})
			},
			submit(){
				uni.switchTab({
					url: "/pages/index/index"
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #35CBAD;
	}

	.logo {
		text-align: center;
		color: #fff;
		font-size: 40rpx;
		font-weight: bold;
		margin-top: 180rpx;

		image {
			width: 104rpx;
			height: 104rpx;
		}
	}

	.form {
		background-color: #fff;
		border-radius: 20rpx;
		padding: 0 40rpx;
		margin-top: 50rpx;

		.col {
			display: flex;
			align-items: center;
			padding: 40rpx 0;
			border-bottom: 1px solid #eee;
			position: relative;

			image {
				width: 36rpx;
				height: 36rpx;
			}

			input {
				font-size: 28rpx;
				padding: 0 20rpx;
			}
		}
	}

	.term {
		background-color: #fff;
		border-radius: 24rpx 24rpx 0 0;
		padding: 60px 120rpx 150rpx;

		.col {
			font-size: 40rpx;
			color: #4095e5;
			line-height: 1.7;
		}

		.btns {
			display: flex;
			justify-content: space-between;
			margin-top: 100rpx;

			.btn {
				border-radius: 8rpx;
				line-height: 60rpx;
				width: 160rpx;
				text-align: center;
				font-size: 28rpx;
				font-weight: bold;
			}

			.agree {
				background-color: #51C76C;
			}

			.refuse {
				background-color: rgba($color: #ff0000, $alpha: 0.25);
				color: #ff0000;
			}
		}
	}

	.submit {
		background: linear-gradient(180deg, #4095E5, #51C76C);
		text-align: center;
		border-radius: 100px;
		color: #fff;
		line-height: 82rpx;
		font-size: 32rpx;
		margin-top: 160rpx;
	}

	.loginBtn {
		text-align: right;
		margin-top: 16rpx;

		text {
			background-color: #4BB398;
			color: #fff;
			line-height: 60rpx;
			font-size: 32rpx;
			width: 160rpx;
			display: inline-block;
			text-align: center;
			border-radius: 16rpx;
		}
	}
</style>